package com.baitiaojun.video.api;

import com.baitiaojun.api.domain.video.VideoComment;
import com.baitiaojun.api.util.ConstantUtil;
import com.baitiaojun.api.vo.JsonRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

/**
 * @类名 VideoCommentApi
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2022/12/27 14:28
 * @版本 1.0
 */
@Api("视频评论接口")
@RequestMapping("/video/comment")
public interface VideoCommentApi {

    @ApiOperation("添加一级评论")
    @PostMapping("/new-parent-video-comment")
    JsonRes addParentVideoComment(@ApiParam(value = "视频评论实体", required = true) @RequestBody VideoComment videoComment) throws Exception;

    @ApiOperation("添加二级评论")
    @PostMapping("/new-child-video-comment")
    JsonRes addChildVideoComment(@ApiParam(value = "视频评论实体", required = true) @RequestBody VideoComment videoComment) throws Exception;

    @ApiOperation("查看视频的一级评论列表")
    @GetMapping("/search-page-video-comment-list")
    JsonRes getPageVideoCommentList(@ApiParam(value = "页码", example = "1") @RequestParam(defaultValue = ConstantUtil.VIDEO_COMMENT_PAGE_NO) Integer pageNo
                                  , @ApiParam(value = "视频id", required = true) @RequestParam Long videoId) throws Exception;

    @ApiOperation("查看某条一级评论下的所有二级评论列表")
    @GetMapping("/search-page-child-video-comment-list")
    JsonRes getPageChildVideoCommentList(@ApiParam(value = "页码", example = "1") @RequestParam(defaultValue = ConstantUtil.CHILD_VIDEO_COMMENT_PAGE_NO) Integer pageNo
                                       , @ApiParam(value = "页码", example = "10") @RequestParam(defaultValue = ConstantUtil.CHILD_VIDEO_COMMENT_PAGE_SIZE) Integer pageSize
                                       , @ApiParam(value = "视频id", required = true) @RequestParam Long videoId, @ApiParam(value = "一级评论id", required = true) @RequestParam Long rootId) throws Exception;

    @ApiOperation("删除二级评论")
    @DeleteMapping("/cancel-video-child-comment")
    JsonRes removeVideoChildComment(@ApiParam(value = "二级评论id", required = true) @RequestParam Long id) throws Exception;

    @ApiOperation("删除一级评论")
    @DeleteMapping("/cancel-video-comment")
    JsonRes removeVideoComment(@ApiParam(value = "一级评论id", required = true) @RequestParam Long id) throws Exception;

    @ApiOperation("查看当前用户收到的所有评论回复")
    @GetMapping("/search-reply-video-comment-list")
    JsonRes getReplayVideoCommentList() throws Exception;

    @GetMapping("/video-comment-count")
    Integer getVideoCommentCount(@RequestParam("videoId") Long videoId);

    @GetMapping("append-comments")
    JsonRes getAppendComments(@RequestParam Long commentId);
}